class Solution(object):
    def canJump(self, nums):
        if len(nums)<=1 :
            return True
        index=0
        maxStep=0
        for i in range(len(nums)):
            maxStep=max(maxStep,i+nums[i])
            if index>=maxStep and i<len(nums)-1:
                return False
            index+=1
        return True
x=Solution()
nums = [2,0,0]
print(x.canJump(nums))